using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using RideMe.Core;

namespace RideMe.Presentation
{
    public partial class GeneralOptionsPanel : UserControl 
    {
        public GeneralOptionsPanel()
        {
            InitializeComponent();
        }

        /// <summary>
        /// Gets or sets the ruby path.
        /// </summary>
        /// <value>The ruby path.</value>
        public string RubyPath
        {
            get { return locationOfRubyTextBox.Text; }
            set { locationOfRubyTextBox.Text = value; }
        }

        /// <summary>
        /// Gets or sets the web server port.
        /// </summary>
        /// <value>The web server port.</value>
        public int WebServerPort
        {
            get { return Convert.ToInt32(webServerPortTextBox.Text); }
            set { webServerPortTextBox.Text = value.ToString(); }
        }

        public LineEndingStyle LineEndings
        {
            get { return (LineEndingStyle)lineEndingsComboBox.SelectedIndex; }
            set { lineEndingsComboBox.SelectedIndex = (int)value; }
        }

		public bool RunScriptServer
		{
			get { return runScriptServer.Checked; }
			set { runScriptServer.Checked = value; }
		}

        public bool LoadLastProjectOnStartUp
        {
            get { return loadLastProjectCheckBox.Checked; }
            set { loadLastProjectCheckBox.Checked = value; }
              
        }

		public bool LaunchInternalBrowser
		{
			get { return launchInternalBrowser.Checked; }
			set { launchInternalBrowser.Checked = value; }
		}

        /// <summary>
        /// Handles the Click event of the browseButton control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param>
        private void browseButton_Click(object sender, EventArgs e)
        {
            if (folderBrowserDialog.ShowDialog() == DialogResult.OK)
            {
                locationOfRubyTextBox.Text = folderBrowserDialog.SelectedPath;
            }
        }

    }
}
